home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / _stddef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  2.5 KB  |  129 lines

  1. /*  _stddef.h
  2.  
  3.     multi-includable Definitions for common types, and NULL
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 9.0
  9.  *
  10.  *      Copyright (c) 1987, 1998 by Borland International
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14. /* $Revision:   9.1  $ */
  15.  
  16. #ifndef ___STDDEF_H
  17. #define ___STDDEF_H
  18.  
  19. #if !defined(___DEFS_H)
  20. #include <_defs.h>
  21. #endif
  22.  
  23. #ifndef NULL
  24. #include <_null.h>
  25. #endif
  26.  
  27. #ifdef __cplusplus
  28. namespace std {
  29. #endif /* __cplusplus */
  30.  
  31. /* Define __STD to expand to std:: or nothing depending on being in C++. */
  32. #ifdef __cplusplus
  33. #  define __STD std::
  34. #else
  35. #  define __STD
  36. #endif
  37.  
  38. /*
  39.    Define the size_t type in the std namespace if in C++ or globally if in C.
  40.    If we're in C++, make the _SIZE_T macro expand to std::size_t
  41. */
  42.  
  43. #if !defined(_SIZE_T) && !defined(_SIZE_T_DEFINED)
  44. #  define _SIZE_T_DEFINED
  45.    typedef unsigned int size_t;
  46. #  if defined(__cplusplus)
  47. #    define _SIZE_T std::size_t
  48. #  else
  49. #    define _SIZE_T size_t
  50. #  endif
  51. #endif
  52.  
  53.  
  54. #if !defined(RC_INVOKED)
  55.  
  56. #if defined(__STDC__)
  57. #pragma warn -nak
  58. #endif
  59.  
  60. #endif  /* !RC_INVOKED */
  61.  
  62. #ifndef _PTRDIFF_T
  63. #define _PTRDIFF_T
  64. typedef int     ptrdiff_t;
  65. #endif
  66.  
  67.  
  68. #define offsetof( s_name, m_name )  (_SIZE_T)&(((s_name _FAR *)0)->m_name)
  69.  
  70. #ifndef __cplusplus
  71. #if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED)
  72. #define _WCHAR_T
  73. #define _WCHAR_T_DEFINED  /* For WINDOWS.H */
  74. typedef unsigned short wchar_t;
  75. #endif
  76. #endif
  77.  
  78. /*
  79.    Define the wint_t type in the std namespace if in C++ or globally if in C.
  80.    If we're in C++, make the _WINT_T macro expand to std::wint_t
  81. */
  82.  
  83. #if !defined(_WINT_T)
  84. typedef wchar_t wint_t;
  85. #  ifdef __cplusplus
  86. #    define _WINT_T std::wint_t
  87. #  else
  88. #    define _WINT_T wint_t
  89. #  endif
  90. #endif
  91.  
  92. #ifndef _WCTYPE_T_DEFINED
  93. typedef wchar_t wctype_t;
  94. #define _WCTYPE_T_DEFINED
  95. #endif
  96.  
  97. #ifdef __cplusplus
  98. extern "C" {
  99. #endif
  100. extern unsigned long _RTLENTRY _EXPFUNC __threadid(void);
  101. #define _threadid (__threadid())
  102.  
  103. #ifdef  __cplusplus
  104. }
  105. #endif
  106.  
  107. #if !defined(RC_INVOKED)
  108.  
  109. #if defined(__STDC__)
  110. #pragma warn .nak
  111. #endif
  112.  
  113. #endif  /* !RC_INVOKED */
  114.  
  115. #ifdef __cplusplus
  116. } // std
  117. #endif /* __cplusplus */
  118.  
  119. #endif  /* __STDDEF_H */
  120.  
  121. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(___STDDEF_H_USING_LIST)
  122. #define ___STDDEF_H_USING_LIST
  123.      using std::ptrdiff_t;
  124.      using std::__threadid;
  125.      using std::size_t;
  126.      using std::wint_t;
  127.      using std::wctype_t;
  128. #endif /* __USING_CNAME__ */
  129.